<?php

namespace app\admin\model\fm;

use think\Model;

/**
 * Bankaccounts
 */
class Bankaccounts extends Model
{
    // 表主键
    protected $pk = 'accountcode';
    
    // 表名
    protected $name = 'fm_bankaccounts';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function accountcodeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'accountcode', 'accountcode');
    }

    public function currcodeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Currencies::class, 'currcode', 'currabrev');
    }

    public function paymentidTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Paymentmethods::class, 'paymentid', 'paymentid');
    }

    public function mobilepayidTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\pay\Mchconfig::class, 'mobilepayid', 'Id');
    }
}